using System;
using System.Collections.Generic;
using UMC.Data;
namespace UMC.WorkFlow.Entities
{
    public partial class TaskForm
    {
        readonly static Action<TaskForm, object>[] _SetValues = new Action<TaskForm, object>[] { (r, t) => r.Caption = Reflection.ParseObject(t, r.Caption), (r, t) => r.Code = Reflection.ParseObject(t, r.Code), (r, t) => r.DateFormat = Reflection.ParseObject(t, r.DateFormat), (r, t) => r.DesignId = Reflection.ParseObject(t, r.DesignId), (r, t) => r.NoteDate = Reflection.ParseObject(t, r.NoteDate), (r, t) => r.NoteTotal = Reflection.ParseObject(t, r.NoteTotal), (r, t) => r.PfxFormat = Reflection.ParseObject(t, r.PfxFormat), (r, t) => r.ProviderKey = Reflection.ParseObject(t, r.ProviderKey), (r, t) => r.SubjectFormat = Reflection.ParseObject(t, r.SubjectFormat), (r, t) => r.TaskId = Reflection.ParseObject(t, r.TaskId), (r, t) => r.TotalFormat = Reflection.ParseObject(t, r.TotalFormat) };
        readonly static string[] _Columns = new string[] { "Caption", "Code", "DateFormat", "DesignId", "NoteDate", "NoteTotal", "PfxFormat", "ProviderKey", "SubjectFormat", "TaskId", "TotalFormat" };
        protected override void SetValue(string name, object obv)
        {
            var index = Utility.Search(_Columns, name, StringComparer.CurrentCultureIgnoreCase);
            if (index > -1) _SetValues[index](this, obv);
        }
        protected override void GetValues(Action<String, object> action)
        {
            AppendValue(action, "Caption", this.Caption);
            AppendValue(action, "Code", this.Code);
            AppendValue(action, "DateFormat", this.DateFormat);
            AppendValue(action, "DesignId", this.DesignId);
            AppendValue(action, "NoteDate", this.NoteDate);
            AppendValue(action, "NoteTotal", this.NoteTotal);
            AppendValue(action, "PfxFormat", this.PfxFormat);
            AppendValue(action, "ProviderKey", this.ProviderKey);
            AppendValue(action, "SubjectFormat", this.SubjectFormat);
            AppendValue(action, "TaskId", this.TaskId);
            AppendValue(action, "TotalFormat", this.TotalFormat);
        }

        protected override RecordColumn[] GetColumns()
        {
            var cols = new RecordColumn[11];
            cols[0] = RecordColumn.Column("Caption", this.Caption);
            cols[1] = RecordColumn.Column("Code", this.Code);
            cols[2] = RecordColumn.Column("DateFormat", this.DateFormat);
            cols[3] = RecordColumn.Column("DesignId", this.DesignId);
            cols[4] = RecordColumn.Column("NoteDate", this.NoteDate);
            cols[5] = RecordColumn.Column("NoteTotal", this.NoteTotal);
            cols[6] = RecordColumn.Column("PfxFormat", this.PfxFormat);
            cols[7] = RecordColumn.Column("ProviderKey", this.ProviderKey);
            cols[8] = RecordColumn.Column("SubjectFormat", this.SubjectFormat);
            cols[9] = RecordColumn.Column("TaskId", this.TaskId);
            cols[10] = RecordColumn.Column("TotalFormat", this.TotalFormat);
            return cols;
        }

    }
}

